1. Field of the Invention
The present invention relates generally to interprocess communications and, more particularly, to an interprocess communications system utilizing shared memory and datagram socket resources.
2. Related Art
The UNIX system has become quite popular since its inception in 1969, implemented on machines of varying, processing power from microprocessors to mainframes and providing a common execution environment across them. The system is divided into two parts: (1) the programs and services which are readily apparent to the user such as the shell, mail, text processing packages, and source code control systems, and (2) the operating system (known as the kernel) that supports these programs and services.
The two more popular and commonly used UNIX systems used today are the AT&T UNIX System V, manufactured by AT&T Bell Laboratories, Murray Hill, N.J., U.S.A., and the Berkeley Software Distribution (BSD) UNIX system, manufactured by University of California at Berkeley, Berkeley, Calif., U.S.A.
Variants of these UNIX systems are available, configured for a specific application or machine. For example, some implementations of the UNIX system interact with a native operating system that, in turn, interacts with the underlying hardware and provides the necessary services to the system. Such configurations allow UNIX installations to run other operating systems and their applications in parallel to the UNIX operating system. Such a configuration includes implementations for the IBM System/370 computers.
UNIX System V and BSD provide Interprocess communication (IPC) mechanisms to allow arbitrary processes to exchange data and synchronize execution. These conventional UNIX IPC mechanisms are inefficient for moderate numbers (more than 6) of asynchronous cooperating processes.
The (byte) stream socket IPC mechanism is the most popular UNIX IPC mechanism. The advantages of the stream socket include high data reliability, high data throughput, and variable message sizes of up to 65,535 bytes. However, these features require a high setup and maintenance overhead, making the stream socket IPC mechanism undesirable for dynamic processes. An additional disadvantage of the stream socket IPC mechanism stems from the nature of the byte stream itself, leaving determination of message boundaries up to the user application program, including resynchronization.
Another conventional UNIX IPC mechanism is the datagram socket IPC mechanism. Advantages of the datagram socket IPC mechanism include low setup and maintenance overhead, high data throughput, and the encapsulation of the message as a packet which is read and written by the application program in its entirety. However, the datagram socket IPC mechanism does not guarantee reliability or message arrival order, leaving these tasks to the user application programs. In addition, the datagram socket limits the size of the messages to 2,048 bytes in length.
A third conventional UNIX IPC mechanism is the use of shared memory. The shared memory IPC mechanism represents the simplest conceptual model of the UNIX IPC mechanisms. Shared memory IPC mechanisms include a very high data throughput, effectively equivalent to a memory-to-memory copy. Additionally, message size is only limited by the amount of shared memory allocated and available (a system imposed limitation), and data reliability is high. The most notable disadvantage of this IPC mechanism is that there is no asynchronous notification mechanism for the receiving user process. Hence, instead of the receiving process being notified of a message, it must periodically access shared memory to detect a message.
None of these conventional IPC mechanisms have the capability to support moderate numbers of asynchronous, cooperating processes, each supporting a moderate number of variable-sized messages (perhaps greater than 65,535 bytes) in a manner transparent to the cooperating user processes. What is needed is an IPC mechanism which provides very high data throughput and reliability for variable-sized messages. The IPC mechanism should have low setup and maintenance overhead in order to support communications between potentially large numbers of both static and dynamic processes. Implementation of the IPC mechanism should require little or no modification to the host operating system.